package mapper;

import BO.EncodeBO;
import BO.EncodeWorkBO;
import DO.WorkEncodeDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WorkEncodeMapper {
    // 保存编程题信息
    void save(WorkEncodeDO workEncodeDO);

    // 根据workId查询出全部编程题id和该题的分值
    @Select("select encode_id,score from work_encode where work_id = #{id} order by `order`")
    List<EncodeWorkBO> getWorkEncode(Integer id);

    // 根据id获取题目数据
    @Select("select score from work_encode where work_id = #{workId} and encode_id = #{encodeId}")
    Double getScoreById(Integer encodeId,Integer workId);
}
